package org.luxor.commons.sms.config.properies;

import org.luxor.commons.sms.constant.SmsType;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.NestedConfigurationProperty;

/**
 * 短信服务基础配置
 *
 * @author Mr.Yan  @date: 2021/1/7
 */
@ConfigurationProperties(prefix = SmsProperties.PREFIX)
public class SmsProperties {
    public static final String PREFIX = "spring.sms";

    private final SmsType DEFAULT_SMS_TYPE = SmsType.aliyun;
    private final QcloudProperties DEFAULT_QCLOUD_PROPERTIES = new QcloudProperties();
    private final AliyunProperties DEFAULT_ALIYUN_PROPERTIES = new AliyunProperties();

    /**
     * 选择哪种短信服务类型?
     */
    private SmsType smsType;

    /**
     * 腾讯云短信服务配置
     */
    @NestedConfigurationProperty
    private QcloudProperties qcloud;

    /**
     * 阿里云短信服务配置
     */
    @NestedConfigurationProperty
    private AliyunProperties aliyun;

    public SmsProperties() {
        this.smsType = DEFAULT_SMS_TYPE;
        this.qcloud = DEFAULT_QCLOUD_PROPERTIES;
        this.aliyun = DEFAULT_ALIYUN_PROPERTIES;
    }

    public SmsType getSmsType() {
        return smsType;
    }

    public void setSmsType(SmsType smsType) {
        this.smsType = smsType;
    }

    public QcloudProperties getQcloud() {
        return qcloud;
    }

    public void setQcloud(QcloudProperties qcloud) {
        this.qcloud = qcloud;
    }

    public AliyunProperties getAliyun() {
        return aliyun;
    }

    public void setAliyun(AliyunProperties aliyun) {
        this.aliyun = aliyun;
    }

}
